home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / sys / audioio.h < prev    next >
C/C++ Source or Header  |  1990-04-12  |  2KB  |  58 lines

  1. /*    "@(#)audioio.h 1.21 89/04/20 SMI"
  2. */
  3.  
  4. /*  These are the ioctl calls for the SPARCstation 1 audio device.  This
  5.  *  interface is preliminary and subject to change in future releases.
  6.  *  You are encouraged to design your code in a modular fashion so that
  7.  *  future changes to the interface can be incorporated with little trouble.
  8.  */
  9.  
  10. /*  This is the generalized structure for accessing the audio device registers.
  11.  *
  12.  *  Control specifies the register to which we are writing, plus the length
  13.  *  of the register, in bytes.  The two values are combined to make it easier
  14.  *  to use.  The register is in the high byte, and the length is in the
  15.  *  low byte.  Macros in sbusdev/audioreg.h make it easier to create the
  16.  *  values for the control member.
  17.  *
  18.  *  By setting the register value appropriately, multiple registers can
  19.  *  be loaded with one operation.  The maximum number of bytes loaded at
  20.  *  one time is 46, when all the MAP registers are set.
  21.  */
  22.  
  23. struct    audio_ioctl {
  24.     short    control;
  25.     unsigned char    data[46];
  26. };
  27.  
  28.  
  29. /*  Ioctl calls for the device.
  30.  *
  31.  *  GETREG and SETREG are used to read and write the chip's registers,
  32.  *  using the audio_ioctl structure to pass data back and forth.
  33. */
  34.  
  35. #define AUDIOGETREG        _IOWR('i',1,struct audio_ioctl)
  36. #define AUDIOSETREG        _IOW('i',2,struct audio_ioctl)
  37.  
  38. /*  READSTART tells the device driver to start reading sound.  This is
  39.  *  useful for starting recordings when you don't want to call read()
  40.  *  until later.  STOP stops all i/o and clears the buffers, while
  41.  *  PAUSE stops i/o without clearing the buffers.  RESUME resumes i/o
  42.  *  after a PAUSE.  These ioctl's don't transfer any data.
  43.  */
  44. #define AUDIOREADSTART        _IO(1,3)
  45. #define AUDIOSTOP        _IO(1,4)
  46. #define AUDIOPAUSE        _IO(1,5)
  47. #define AUDIORESUME        _IO(1,6)
  48.  
  49. /*  READQ is the number of bytes that have been read but not passed to
  50.  *  the application.  WRITEQ is the number of bytes passed into
  51.  *  the driver but not written to the device.  QSIZE is the number of bytes
  52.  *  in the queue.
  53.  */
  54. #define AUDIOREADQ        _IOR(1,7,int)
  55. #define AUDIOWRITEQ        _IOR(1,8,int)
  56. #define AUDIOGETQSIZE        _IOR(1,9,int)
  57. #define AUDIOSETQSIZE        _IOW(1,10,int)
  58.